package com.mida.dms.knw.api;


import com.mida.dms.knw.entity.KnwCompositeInstance;
import com.mida.dms.knw.entity.vo.KnwCompositeInstanceDto;
import com.mida.dms.knw.vo.KnwCompositeInstanceVo;
import com.mida.dms.knw.vo.KnwCompositeTmpVo;
import com.mida.dms.knw.vo.PageResultVo;
import com.mida.tool.common.result.ActionResult;
import com.mida.tool.common.result.ListResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.context.annotation.DependsOn;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

import static com.mida.tool.common.result.BaseResult.buildListSuccess;

/**
 * @Author: binziyang
 * @Description:
 * @Date: 2021/6/29 13:26
 * @params:
 */
@DependsOn("loadFromDatabasePropertyConfig")
//@FeignClient(name = "KnwCompositeInstanceApi", url = "${dms.knw.feign.url}")
@FeignClient(name = "KnwCompositeInstanceApi", url = "dms.knw.feign.url")
public interface KnwCompositeInstanceApi {

    /**
     * 新增复合实例表
     * @param knwCompositeInstanceVo
     * @return
     */
    @PostMapping(value = "/knwCompositeInstance/addKnwCompositeInstance",consumes = {"application/json"})
    @ResponseBody
    ActionResult addKnwCompositeInstance(@RequestBody KnwCompositeInstanceVo knwCompositeInstanceVo);

    /**
     * 修改复合实例数据
     *
     * @param knwCompositeInstanceVo
     * @return
     */
    @PostMapping(value = "/knwCompositeInstance/updateKnwCompositeInstance",consumes = {"application/json"})
    @ResponseBody
    ActionResult updateKnwCompositeInstance(@RequestBody KnwCompositeInstanceVo knwCompositeInstanceVo);

    /**
     * 删除复合实例数据
     *
     * @param knwCompositeInstanceVo 对象接收前端传入的json
     * @return
     */
    @PostMapping(value = "/knwCompositeInstance/deleteKnwCompositeInstance",consumes = {"application/json"})
    @ResponseBody
    ActionResult deleteKnwCompositeInstance(@RequestBody KnwCompositeInstanceVo knwCompositeInstanceVo);


    /**
     * 查询复合实例分页列表处理
     *
     * @param knwCompositeInstanceVo 对象接收前端传入的json
     * @return
     */
    @PostMapping(value = "/knwCompositeInstance/getKnwCompositeInstancePage",consumes = {"application/json"})
    ListResult<PageResultVo<KnwCompositeInstanceDto>> getKnwCompositeInstancePage(
            @RequestBody KnwCompositeInstanceVo knwCompositeInstanceVo);

    /**
     * 排序复合实例
     *
     * @param
     * @return
     */
    @PostMapping(value = "/knwCompositeInstance/updateSort",consumes = {"application/json"})
    ActionResult updateSort(@RequestBody List<KnwCompositeInstanceVo> knwCompositeInstanceVoList);


    /**
     * 查询复合实例表处理
     *
     * @param knwCompositeInstanceVo 对象接收前端传入的json
     * @return
     */
    @PostMapping(value = "/knwCompositeInstance/getKnwCompositeInstanceList",consumes = {"application/json"})
    ListResult<List<KnwCompositeInstanceDto>> getKnwCompositeInstanceList(
            @RequestBody KnwCompositeInstanceVo knwCompositeInstanceVo);

    /**
     * 启用与禁用复合实例数据
     *
     * @param knwCompositeInstanceVo
     * @return
     */
    @PostMapping(value = "/knwCompositeInstance/enableKnwCompositeInstance",consumes = {"application/json"})
    @ResponseBody
    public ActionResult enableKnwCompositeInstance(@RequestBody KnwCompositeInstanceVo knwCompositeInstanceVo);

    /**
     * 添加复合
     * @param vo
     * @return
     */
    @PostMapping(value = "/knwCompositeInstance/addKnwComposite",consumes = {"application/json"})
    @ResponseBody
    ActionResult addKnwComposite(@RequestBody KnwCompositeTmpVo vo);
}
